﻿using PhantomRealm.Common.Players;
using Terraria;
using Terraria.ID;

namespace PhantomRealm.Common.Utilities
{
    public static class ZoneHelper
    {
        #region Biomes
        public static bool ZoneAurora(this Player player) => player.GetModPlayer<AuroraPlayer>().AuroraActive;
        public static bool ZoneSurface(this Player player) => player.ZoneOverworldHeight;
        public static bool ZoneSnow(this Player player) => player.ZoneSnow;
        public static bool ZoneCorrupt(this Player player) => player.ZoneCorrupt;
        public static bool ZoneCrimson(this Player player) => player.ZoneCrimson;
        public static bool ZoneMeteor(this Player player) => player.ZoneMeteor;
        public static bool ZoneDungeon(this Player player) => player.ZoneDungeon;
        public static bool ZoneUnderworld(this Player player) => player.ZoneUnderworldHeight;
        public static bool ZoneJungle(this Player player) => player.ZoneJungle;
        public static bool ZoneDesert(this Player player) => player.ZoneDesert;
        public static bool ZoneHallow(this Player player) => player.ZoneHallow;
        public static bool ZoneBeach(this Player player) => player.ZoneBeach;
        public static bool ZoneSky(this Player player) => player.ZoneSkyHeight;
        public static bool ZoneHive(this Player player) => player.ZoneHive;
        #endregion

        #region Events
        public static bool IsBloodMoon(this Player player) => Main.bloodMoon;
        public static bool IsEclipse(this Player player) => Main.eclipse;
        public static bool IsRainy(this Player player) => Main.raining;
        public static bool IsSlimeRain(this Player player) => Main.slimeRain;
        public static bool IsPumpkinMoon(this Player player) => Main.pumpkinMoon;
        public static bool IsSnowMoon(this Player player) => Main.snowMoon;
        public static bool IsGoblinInvasion(this Player player) => Main.invasionType == InvasionID.GoblinArmy && Main.invasionSize > 0;
        public static bool IsPirateInvasion(this Player player) => Main.invasionType == InvasionID.PirateInvasion && Main.invasionSize > 0;
        public static bool IsMartianInvasion(this Player player) => Main.invasionType == InvasionID.MartianMadness && Main.invasionSize > 0;
        #endregion

        #region Times
        public static bool IsDay(this Player player) => Main.dayTime;
        public static bool IsNight(this Player player) => !Main.dayTime;
        #endregion

        #region Difficulties
        public static bool IsExpertMode(this Player player) => Main.expertMode;
        public static bool IsMasterMode(this Player player) => Main.masterMode;
        public static bool IsJourneyMode(this Player player) => Main.GameModeInfo.IsJourneyMode;
        public static bool IsHardMode(this Player player) => Main.hardMode;
        public static bool IsEasyMode(this Player player) => !Main.hardMode;
        #endregion
    }
}
